package com.ruoyi.app.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.app.domain.ShopInfo;
import com.ruoyi.app.domain.vo.ShopInfoVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 店铺信息Mapper接口
 * 
 * @author ruoyi
 * @date 2023-12-21
 */
public interface ShopInfoMapper extends BaseMapper<ShopInfo> {

    /**
     * 根据店铺ID查询店铺信息
     *
     * @param userId 店铺ID
     * @return 店铺信息
     */
    @Select("select si.*,su.IS_MANAGER,su.IS_DEFAULT from shop_info si INNER JOIN shop_user su ON si.ID = su.SHOP_ID AND su.DEL_FLAG = 0 WHERE si.DEL_FLAG = 0 AND si.ID = #{shopId} AND su.USER_ID = #{userId}")
    ShopInfoVo getShopInfoByUserIdAndShopId(@Param("userId") String userId, @Param("shopId") String shopId);
}
